const { ErrorModel } = require('../model/resModel')

module.exports = async (ctx, next) => {
  if (ctx.session.username) {
    console.log(ctx.session.username)
    next()
    return
  }
  return ctx.body = new ErrorModel('未登录')
}